package servicos;

import dominio.Item;
import persistencia.ItemDAO;
import persistencia.base.DAOException;
import persistencia.base.DAOFactory;

public class ItemRN {

	private ItemDAO itemDAO = DAOFactory.getItemDAO();

	public void salvar(Item item) throws FalhaDeInclusaoException {

		try {

			itemDAO.getSession().beginTransaction();
			itemDAO.save(item);
			itemDAO.getSession().getTransaction().commit();

		} catch (DAOException e) {
			e.printStackTrace();
			throw new FalhaDeInclusaoException();
		}
	}

}
